package com.oig.sys.auth.dto;

import com.oig.common.validator.GroupAdd;
import com.oig.common.validator.GroupEdit;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

@Data
@Schema(description = "角色参数类")
public class RoleDto {

    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "参数错误,id不能为空", groups= GroupEdit.class)
    private Integer id;
    @Schema(description = "编码", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotEmpty(message = "参数错误，编码不能为空", groups={GroupAdd.class, GroupEdit.class})
    private String roleCode;
    @Schema(description = "名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotEmpty(message = "参数错误，名称不能为空", groups={GroupAdd.class, GroupEdit.class})
    private String roleName;

    @Schema(description = "是否允许删除 1-允许 0-不允许")
    private String noDelFlag;

    @Schema(description = "所属租户id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "参数错误,所属租户id不能为空", groups={GroupAdd.class, GroupEdit.class})
    private Integer tenantId;
    @Schema(description = "租户编码")
    private String tenantCode;
    @Schema(description = "所属租户名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    //@NotEmpty(message = "参数错误，所属租户名称不能为空", groups={GroupAdd.class, GroupEdit.class})
    private String tenantName;

    @Schema(description = "角色可用子应用,配置角色应用权限，只需传应用id")
    private List<SystemDto>     roleSystemList;
    @Schema(description = "角色所有子应用菜单,配置角色菜单权限，只需传菜单id")
    private List<ResourceDto>   roleResourceList ;

    @Schema(description = "角色权限,配置角色接口权限， 菜单已配置了对应的接口权限，所以如果不是特殊情况，不需要传这个")
    private List<PermissionDto> rolePermissionList;

}
